﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="UserManage.aspx.cs" Inherits="Trangtrai.tochuc.UserManage" MasterPageFile="~/SiteMaster.Master" %>
<%@ Register assembly="DevExpress.Web.ASPxGridView.v11.1, Version=11.1.8.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxGridView" tagprefix="dx" %>
<%@ Register assembly="DevExpress.Web.ASPxEditors.v11.1, Version=11.1.8.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxEditors" tagprefix="dx" %>
<asp:Content ID="Content1" runat="server" 
    contentplaceholderid="ContentPlaceHolder1">
     <script type="text/javascript">
         // <![CDATA[
         function OnRoleChanged(cmbCountry) {
             grid.GetEditor("roleName").PerformCallback(cmbCountry.GetValue().toString());
         }
         // ]]> 
    </script>
    <br /><br /><br /><br /><br />
    <center>
        <table width="960px" runat="server">
             <tr>
                <td bgcolor="#94B6EF" align="left">
                    
                    <dx:ASPxLabel ID="lblMess" runat="server" >
                    </dx:ASPxLabel>
                </td>
            </tr>
            <tr>
                <td bgcolor="#94B6EF" align="center">
                    
                    <dx:ASPxLabel ID="ASPxLabel1" runat="server" Text="QUẢN LÝ NHÂN VIÊN">
                    </dx:ASPxLabel>
                </td>
            </tr>
            
           
            <tr>
                <td>
                   <table width="960px" bgcolor="White" style="border: thin solid #94B6EF">
                        <tr>
                            <td class="style5"></td>
                            <td align ="left" class="style1" bgcolor="#94B6E8">
                                <dx:ASPxLabel ID="ASPxLabel2" runat="server" Text="Mã Nhân viên">
                                </dx:ASPxLabel>
                            </td>
                            <td align="left" class="style3">
                                <dx:ASPxTextBox ID="tbxUserCode" runat="server" Width="170px" 
                                    CssFilePath="~/App_Themes/Office2003Blue/{0}/styles.css" 
                                    CssPostfix="Office2003Blue" 
                                    SpriteCssFilePath="~/App_Themes/Office2003Blue/{0}/sprite.css">
                                </dx:ASPxTextBox>
                            </td>
                            <td align="left" class="style4" bgcolor="#94B6E8">
                                
                                <dx:ASPxLabel ID="ASPxLabel3" runat="server" Text="Tên nhân viên">
                                </dx:ASPxLabel>
                                
                            </td>
                            <td align="left">
                                <dx:ASPxTextBox ID="tbxName" runat="server" Width="170px" 
                                    CssFilePath="~/App_Themes/Office2003Blue/{0}/styles.css" 
                                    CssPostfix="Office2003Blue" 
                                    SpriteCssFilePath="~/App_Themes/Office2003Blue/{0}/sprite.css">
                                </dx:ASPxTextBox>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="5"><br /></td>
                        </tr>
                        <tr>
                            <td class="style5"></td>
                            <td align ="left" class="style1" bgcolor="#94B6E8">
                                <dx:ASPxLabel ID="ASPxLabel4" runat="server" Text="Địa chỉ">
                                </dx:ASPxLabel>
                            </td>
                            <td align="left" class="style3">
                                <dx:ASPxTextBox ID="tbxAddress" runat="server" Width="170px" 
                                    CssFilePath="~/App_Themes/Office2003Blue/{0}/styles.css" 
                                    CssPostfix="Office2003Blue" 
                                    SpriteCssFilePath="~/App_Themes/Office2003Blue/{0}/sprite.css">
                                </dx:ASPxTextBox>
                            </td>
                            <td align="left" class="style4" bgcolor="#94B6E8">
                                
                                <dx:ASPxLabel ID="ASPxLabel5" runat="server" Text="Số ĐT">
                                </dx:ASPxLabel>
                                
                            </td>
                            <td align="left">
                                <dx:ASPxTextBox ID="tbxPhone" runat="server" Width="170px" 
                                    CssFilePath="~/App_Themes/Office2003Blue/{0}/styles.css" 
                                    CssPostfix="Office2003Blue" 
                                    SpriteCssFilePath="~/App_Themes/Office2003Blue/{0}/sprite.css">
                                </dx:ASPxTextBox>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="5"><br /></td>
                        </tr>
                        <tr>
                             <td class="style5"></td>
                            <td align ="left" class="style1" bgcolor="#94B6E8">
                                <dx:ASPxLabel ID="ASPxLabel6" runat="server" Text="Tình trạng">
                                </dx:ASPxLabel>
                            </td>
                            <td align="left" class="style3">
                                
                                <dx:ASPxComboBox ID="cbxStatus" runat="server" 
                                    CssFilePath="~/App_Themes/Office2003Blue/{0}/styles.css" 
                                    CssPostfix="Office2003Blue" 
                                    SpriteCssFilePath="~/App_Themes/Office2003Blue/{0}/sprite.css" 
                                    ValueType="System.String" TextField="statusName" ValueField="userStatusId">
                                    <LoadingPanelImage Url="~/App_Themes/Office2003Blue/Web/Loading.gif">
                                    </LoadingPanelImage>
                                </dx:ASPxComboBox>
                                
                            </td>
                            <td align="left" class="style4" bgcolor="#94B6E8">
                                
                                <dx:ASPxLabel ID="ASPxLabel7" runat="server" Text="Chức vụ">
                                </dx:ASPxLabel>
                                
                            </td>
                            <td align="left">
                                
                                <dx:ASPxComboBox ID="cbxRole" runat="server"  
                                    CssFilePath="~/App_Themes/Office2003Blue/{0}/styles.css" 
                                    CssPostfix="Office2003Blue" 
                                    SpriteCssFilePath="~/App_Themes/Office2003Blue/{0}/sprite.css" 
                                    ValueType="System.String" TextField="roleName" ValueField="roleID">
                                    <LoadingPanelImage Url="~/App_Themes/Office2003Blue/Web/Loading.gif">
                                    </LoadingPanelImage>
                                    
                                </dx:ASPxComboBox>
                                
                            </td>
                        </tr>
                        <tr>
                            <td></td>
                            <td colspan="4" align="left" bgcolor="#94B6E8">
                                
                                <dx:ASPxButton ID="btnAdd" runat="server" 
                                    CssFilePath="~/App_Themes/SoftOrange/{0}/styles.css" CssPostfix="SoftOrange" 
                                    SpriteCssFilePath="~/App_Themes/SoftOrange/{0}/sprite.css" Text="Thêm mới" 
                                    onclick="btnAdd_Click">
                                </dx:ASPxButton>
                                
                            </td>
                        </tr>
                   </table> 
                </td>
            </tr>
            <tr>
                <td>
                
                    <dx:ASPxGridView ID="dtgUserList" ClientInstanceName="dtgUserList" 
                        runat="server" Width="960px" 
                        AutoGenerateColumns="False" 
                        CssFilePath="~/App_Themes/Office2003Blue/{0}/styles.css" 
                        CssPostfix="Office2003Blue" 
                        KeyFieldName="userId" onrowupdating="dtgUserList_RowUpdating" 
                        oncelleditorinitialize="dtgUserList_CellEditorInitialize" 
                        onrowdeleting="dtgUserList_RowDeleting">
                        <SettingsBehavior ConfirmDelete="True" />
                        <Styles CssFilePath="~/App_Themes/Office2003Blue/{0}/styles.css" 
                            CssPostfix="Office2003Blue">
                            <Header ImageSpacing="5px" SortingImageSpacing="5px">
                            </Header>
                            <LoadingPanel ImageSpacing="10px">
                            </LoadingPanel>
                        </Styles>
                        <ImagesFilterControl>
                            <LoadingPanel Url="~/App_Themes/Office2003Blue/Editors/Loading.gif">
                            </LoadingPanel>
                        </ImagesFilterControl>
                        <Images SpriteCssFilePath="~/App_Themes/Office2003Blue/{0}/sprite.css">
                            <LoadingPanelOnStatusBar Url="~/App_Themes/Office2003Blue/GridView/gvLoadingOnStatusBar.gif">
                            </LoadingPanelOnStatusBar>
                            <LoadingPanel Url="~/App_Themes/Office2003Blue/GridView/Loading.gif">
                            </LoadingPanel>
                        </Images>
                        <SettingsText CommandDelete="Bạn có muốn xóa ?" />
                        <Columns>
                            <dx:GridViewDataTextColumn Caption="Tên nhân viên" FieldName="fullName" 
                                VisibleIndex="1">
                            </dx:GridViewDataTextColumn>
                            <dx:GridViewDataTextColumn Caption="Mã nhân viên" FieldName="userCode" 
                                VisibleIndex="0">
                            </dx:GridViewDataTextColumn>
                            <dx:GridViewDataTextColumn Caption="Số điện thoại" FieldName="phone" 
                                VisibleIndex="3">
                            </dx:GridViewDataTextColumn>
                            <dx:GridViewDataTextColumn Caption="Địa chỉ" FieldName="address" 
                                VisibleIndex="2">
                            </dx:GridViewDataTextColumn>
                            <dx:GridViewCommandColumn ButtonType="Image" Caption="Xóa" VisibleIndex="6">
                                <DeleteButton Visible="True">
                                    <Image Url="~/Image/delete.PNG">
                                    </Image>
                                </DeleteButton>
                                <ClearFilterButton Visible="True">
                                </ClearFilterButton>
                            </dx:GridViewCommandColumn>
                            <dx:GridViewCommandColumn ButtonType="Image" Caption="Sửa" VisibleIndex="5">
                                <EditButton Visible="True">
                                    <Image Url="~/Image/modify.PNG">
                                    </Image>
                                </EditButton>
                                <CancelButton>
                                    <Image Url="~/Image/delete.PNG">
                                    </Image>
                                </CancelButton>
                                <UpdateButton>
                                    <Image Url="~/Image/save.PNG">
                                    </Image>
                                </UpdateButton>
                                <ClearFilterButton Visible="True">
                                </ClearFilterButton>
                            </dx:GridViewCommandColumn>
                            
                             <dx:GridViewDataComboBoxColumn Caption="Chức vụ" FieldName="roleName" VisibleIndex="4">
                                <PropertiesComboBox TextField="roleName" ValueField="roleId" EnableSynchronization="False"
                                    IncrementalFilteringMode="StartsWith">
                                    <ClientSideEvents SelectedIndexChanged="function(s, e) { OnRoleChanged(s); }"></ClientSideEvents>
                                </PropertiesComboBox>
                            </dx:GridViewDataComboBoxColumn>
                        </Columns>
                        <Settings ShowFilterRow="True" />
                        <StylesEditors>
                            <ProgressBar Height="25px">
                            </ProgressBar>
                        </StylesEditors>
                    </dx:ASPxGridView>
                
                </td>
            </tr>
          
            <tr>
                <td bgcolor="#94B6EF">
                
                    &nbsp;</td>
            </tr>
        </table>
    </center>
</asp:Content>
<asp:Content ID="Content2" runat="server" contentplaceholderid="head">

    <script type="text/javascript" src="../../js/jquery-latest.js"></script>
    <script type="text/javascript">
        $(document).ready(function() {

            $("ul.subnav").parent().append("<span></span>"); //Only shows drop down trigger when js is enabled - Adds empty span tag after ul.subnav

            $("ul.topnav li span").click(function() { //When trigger is clicked...

                //Following events are applied to the subnav itself (moving subnav up and down)
                $(this).parent().find("ul.subnav").slideDown('fast').show(); //Drop down the subnav on click

                $(this).parent().hover(function() {
                }, function() {
                    $(this).parent().find("ul.subnav").slideUp('slow'); //When the mouse hovers out of the subnav, move it back up
                });
                ;
                //Following events are applied to the trigger (Hover events for the trigger)
            }).hover(function() {
                $(this).addClass("subhover"); //On hover over, add class "subhover"
            }, function() {	//On Hover Out
                $(this).removeClass("subhover"); //On hover out, remove class "subhover"
            });

        });
    </script>
    <style type="text/css">
        .style1
        {
            width: 187px;
        }
        .style3
        {
            width: 279px;
        }
        .style4
        {
            width: 159px;
        }
        .style5
        {
            width: 61px;
        }
    </style>

</asp:Content>

